package goods.api;

import goods.model.SalesPriceRate;
import goods.vo.SalesPriceCalVo;
import goods.vo.SalesPriceRateQueryVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by Liang Wenxu on 2017/1/16.
 */
public interface SalesPriceRateApi {

    /**
     *
     * 获取当前商户所有配置的费率
     * @param salesPriceRateQueryVo
     * @return
     */
    public List<SalesPriceRate> getSalesPriceRate(SalesPriceRateQueryVo salesPriceRateQueryVo);

    /**
     * 根据费率计算销售价格
     *
     * @param salesPriceCalVo@return
     */
    public BigDecimal calSalesPrice(SalesPriceCalVo salesPriceCalVo);

    /**
     * 批量计算售价费率
     * @param salesPriceCalVoList 计算请求Vo列表，请求VO请查询：
     * @see SalesPriceCalVo
     * @return List<Map>，按传入的salesPriceCalVoList顺序返回费率计算后的价格， 返回数据示例->
     *     [{fashionId: 'asdfdfasdf-asdfasdf-asdf-asdfsdf'@String, salePrice:'0.00'@BigDecimal}...]
     */
    public List<Map> calBatchSalesPrice(List<SalesPriceCalVo> salesPriceCalVoList);

    void saveSalesPriceRateList(List<SalesPriceRate> salesPriceRates);

    void saveSalesPriceRate(SalesPriceRate salesPriceRate);

    /**
     * 费率管理分页查询
     * @param organizationId 组织id
     * @param storeId 店铺id
     * @param mode 费率配置模式
     * @param enabled 是否启用
     * @param pageable 分页参数
     * @return
     */
    public Page<SalesPriceRate> findPageByParams(String organizationId, String storeId, String mode, String enabled, Pageable pageable);

    /**
     * 根据id查询未删除的费率对象
     * @param id
     * @return
     */
    public SalesPriceRate findRateById(String id);
}
